Skip to content

Fix fast scroll#635

Merged
SailReal merged 3 commits intodevelopfrom
feature/fix-fast-scroll
Apr 26, 2026
Merged

Fix fast scroll#635
SailReal merged 3 commits intodevelopfrom
feature/fix-fast-scroll

Conversation

@SailReal
Copy link
Copy Markdown
Member

Fixes #623

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c98c29d6-c582-4f9f-9cbf-9e4e4bea9bf9

📥 Commits

Reviewing files that changed from the base of the PR and between 7e6289f and eaa2eb2.

📒 Files selected for processing (1)
  • presentation/src/main/java/org/cryptomator/presentation/ui/fragment/TextEditorFragment.kt

Walkthrough

The PR moves text scrolling out of the edit text into an outer ScrollView, disables the edit text's internal scrolling, and adds visible scroll_track and scroll_thumb placeholders with a new drawable. It introduces attachFastScrollThumb to synchronize a draggable thumb and touchable track with a ScrollView, returning a cleanup lambda. TextEditorFragment now applies system-bar paddings to the wrapper, wires the fast-scroll thumb/track with cleanup, registers a text-change watcher to auto-scroll the caret after edits, posts caret-aware smooth scrolling on match selection, and removes listeners/cleanup in onDestroyView().

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Fix fast scroll' is vague and uses a generic term without clearly describing the primary change or the specific problem being addressed. Consider a more descriptive title that explains what fast scroll fix is being implemented, e.g., 'Implement custom fast-scroll thumb for large text files' or 'Add draggable scroll thumb for improved scrolling usability'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description references the linked issue #623, directly connecting the pull request to the problem being solved.
Linked Issues check ✅ Passed The implementation addresses issue #623 by introducing a custom fast-scroll thumb system that allows users to scroll large text files regardless of line count, solving the usability problem of the default scroll thumb becoming too small.
Out of Scope Changes check ✅ Passed All changes directly support the custom fast-scroll implementation required to fix issue #623 with no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix-fast-scroll

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@presentation/src/main/java/org/cryptomator/presentation/ui/fragment/TextEditorFragment.kt`:
- Around line 144-156: In scrollCaretIntoView(), the layout line coordinates
need to be converted into scroll-content coordinates by adding
editor.paddingTop; update the visibility checks and scroll targets in the
function (referencing scrollCaretIntoView, editor, layout, lineTop, lineBottom,
scroll.scrollY, visibleHeight and scroll.smoothScrollTo) to use paddedTopLine =
editor.paddingTop + lineTop and paddedBottomLine = editor.paddingTop +
lineBottom, then compare paddedTopLine / paddedBottomLine against scroll.scrollY
and scroll.scrollY + visibleHeight and call smoothScrollTo with targets computed
from the padded coordinates.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e488b0c-94c0-4b5e-b3e9-dcb57a376108

📥 Commits

Reviewing files that changed from the base of the PR and between d3c39aa and ca3402b.

📒 Files selected for processing (4)
  • presentation/src/main/java/org/cryptomator/presentation/ui/fragment/TextEditorFragment.kt
  • presentation/src/main/java/org/cryptomator/presentation/ui/layout/FastScrollHelper.kt
  • presentation/src/main/res/drawable/scroll_thumb.xml
  • presentation/src/main/res/layout/fragment_text_editor.xml

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@presentation/src/main/java/org/cryptomator/presentation/ui/fragment/TextEditorFragment.kt`:
- Around line 138-142: The posted caret-scroll runnable and repeated
text-watcher registration must be guarded and cleaned up: change
setupCaretAutoScroll to register a single TextWatcher instance (store it as a
field, e.g., textWatcher) and add it to binding.textEditor in onViewCreated, and
remove it in onDestroyView (mirroring fastScrollCleanup) via
binding.textEditor.removeTextChangedListener(textWatcher); inside the watcher's
callback and the onQuery post call, guard any use of binding by checking if
(!isAdded) return before calling binding.textEditor.post or invoking
scrollCaretIntoView so the posted Runnable won't run against a detached view;
ensure scrollCaretIntoView references remain the same.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 16588f9b-d145-485a-8c76-f470c3d5daa3

📥 Commits

Reviewing files that changed from the base of the PR and between ca3402b and 7e6289f.

📒 Files selected for processing (1)
  • presentation/src/main/java/org/cryptomator/presentation/ui/fragment/TextEditorFragment.kt

@SailReal SailReal merged commit 0af31a0 into develop Apr 26, 2026
3 checks passed
@SailReal SailReal deleted the feature/fix-fast-scroll branch April 26, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to scroll a huge text file

1 participant